'''
Created on 21/11/2011

@author: Marina
'''

from memory import Memory
from firstAdjust import FirstAdjust
from worstAdjust import WorstAdjust
from bestAdjust import BestAdjust
from continua import Continue
from memoryManager import MemoryManager
from paging import Paging


class ManagerFactory:


    def __init__(self):
            '''
            Constructor
            '''


    def memoryManagerContinuousFirstAdjust(self, disco, memorySize):
        memory = Memory(memorySize)
        disc = disco
        first = FirstAdjust()
        continueFirstAdjust = Continue(first, memory)
        manager = MemoryManager(continueFirstAdjust, memory, disc)
        return manager

    def memoryManagerContinuousWorstAdjust(self, disco, memorySize):
        disc = disco
        memory = Memory(memorySize)
        worst = WorstAdjust()
        continueWorst = Continue(worst, memory)
        manager = MemoryManager(continueWorst, memory, disc)
        return manager
        
    def memoryManagerContinuousBestAdjust(self, disco, memorySize):
        disc = disco
        memory = Memory(memorySize)
        best = BestAdjust()
        continueBest = Continue(best, memory)
        manager = MemoryManager(continueBest, memory, disc)
        return manager
    
    def memoryManagerPaging(self, disco, pageSize, memorySize):
        disco=disco
        memory=Memory(memorySize)
        paging= Paging(memory,pageSize, disco)
        manager = MemoryManager(paging, memory, disco)
        return manager